

var ASD = new Class.create();
ASD.prototype = {

    data:{
        PageShow:false
        //表单验证常用字段
        ,rules:{
            notNull:{ validate: (val) => !!val, message: '不能为空'}
            ,min:(min)=>{return { validate: (val) => val.length >= min, message: '字符长度不能小于' + min}}
            ,max:(max)=>{return { validate: (val) => val.length <= max, message: '字符长度不能大于' + max}}
            ,len:(len)=>{return { validate: (val) => val.length === len, message: '字符长度必须为' + len}}
            ,isPhone:{ validate: (val) => { var myreg=/^[1][3,4,5,6,7,8][0-9]{9}$/;if (!myreg.test(val)) {return false;} else {return true;}}, message: '手机号不合法'}
        }
        ,PageRefreshing:false
        ,PageLoadingMore:false
    }
    ,methods:{
        init:function () {}
        ,goback:goback
        ,goto:goto
        ,OnLoad:function () {}
        ,OnShow:function () {}
        ,OnHide:function () {}
        ,OnPullDownRefresh:function () {}
        ,OnPullUpLoadMore:function () {}
    }
    ,initialize:function (options) {
        let _this = this;
        var datas = options.data();
        for(var i in datas){
            console.log(JSON.stringify(typeof datas[i]));
            console.log(JSON.stringify(datas[i]));
            // if(typeof options[i] === "function"){
            //     _this.methods[i] = function () {
            //         return options[i];
            //     }
            // }else {
            //
            // }
            _this.data[i] = datas[i]
        }
        console.log(JSON.stringify(options));
        console.log(JSON.stringify(_this.data));
        console.log(JSON.stringify(_this.methods.OnLoad));
        // apiready = function(){
            var vue = new Vue({
                el:"#Page",
                delimiters: ['[[', ']]'],
                data:_this.data,//基础数据
                methods:options
            })
            return vue
        // }
    }
}